<template>
  <div class="fns-imgDialog-component">
    <el-dialog
      title=""
      :visible.sync="imgDialogData.dialogVisible"
      custom-class="fns-imgDialog-item"
      :close-on-click-modal="false"
      append-to-body>
      <div class="imgbox" v-if="imgDialogData.imgSrc.length === 1">
        <img :src="imgDialogData.imgSrc" alt="图片" >
      </div>
      <div class="block" style="margin-top: 0;height: 100%;text-align: center;" v-else>
        <el-carousel :autoplay="false" :interval="2000">
          <el-carousel-item v-for="item in imgDialogData.imgSrc" :key="item" class="el-carousel-item">
            <img :src="item" alt="图片">
          </el-carousel-item>
        </el-carousel>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  export default {
    props: {
      imgDialogData: {
        dialogVisible: {
          default: false
        }
      }
    },
    computed: {
    },
    watch: {
    },
    components: {
    },
    data() {
      return {
      }
    },
    methods: {
    }
  }
</script>

<style lang="scss">
  /*放大图片弹窗组件imgDialog*/
  .fns-imgDialog-item {
    width: 600px;
    .imgbox {
      width: 100%;
      border: 1px solid #ebebeb;
      text-align: center;
      padding: 10px;
      border-radius: 5px;
      max-height: 500px;
      overflow-y: auto;
      img {
        width: 100%;
      }
    }
    .el-carousel__container {
      border: 1px solid #ebebeb;
      height: auto;
      min-height: 500px;
      .el-carousel-item {
        width: 100%;
        height: 100%;
        padding: 10px;
        overflow-y: auto;
        img {
          width: 100%;
        }
      }
    }
  }
</style>

